package com.dragon.mmochat.model.scheduleJob;

import org.quartz.Job;
import org.quartz.JobExecutionContext;

import com.dragon.mmochat.model.activity.MmochatDoubleAwardActivity;
import com.dragon.mmochat.model.activity.MmochatSystemState;
import com.dragon.mmochat.service.MmochatChatService;

//双倍活动
public class DoubleAwardActivityJob implements Job {
	@Override
	public void execute(JobExecutionContext context) {
		try {
			MmochatDoubleAwardActivity doubleAward = (MmochatDoubleAwardActivity) context
					.getJobDetail().getJobDataMap().get("data");
			if (doubleAward != null) {
				MmochatSystemState.setSystemDoubleAward(doubleAward
						.isSystemDoubleAwardState());
				if (doubleAward.getSystemMsg() != null) {
					MmochatChatService
							.sendSystemMsg(doubleAward.getSystemMsg());
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
